<%-- 
    Document   : ketquatimkiem
    Created on : Oct 8, 2011, 10:29:17 AM
    Author     : Rocker000
--%>

<%@page import="pojo.SanPham_pojo"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>


<%
ArrayList<SanPham_pojo> ds = (ArrayList<SanPham_pojo>)request.getAttribute("dssanphamtimthay");
ArrayList<SanPham_pojo> ds_theophantrang = (ArrayList<SanPham_pojo>)request.getAttribute("dssanphamtimthayphantrang");
String keyword = String.valueOf(request.getAttribute("keyword"));
int sotrang = Integer.parseInt(String.valueOf(request.getAttribute("sotrang")));
String loai = String.valueOf(request.getAttribute("loai"));
%>
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0">
  <tr>
    <td>Trang 
        <%for(int i = 1;i<=sotrang;i++){ %> 
        <a href="sanpham_controller?action=timkiemsanpham&&txtkey=<%=keyword%>&&cbloaisanpham=<%=loai%>&&trang=<%=i %>">
        <%=i %>
        </a>
        
        <%}%>
    </td>
  </tr>
  <%for(int i =0;i<ds_theophantrang.size();i++){ SanPham_pojo sp = ds_theophantrang.get(i); %>
  <tr>
    <td>
        
        <table width="100%" border="1">
      <tr>
        <td width="27%"><Strong><font color="green"><%=sp.getTenSanPham() %></font></strong></td>
        <td width="73%" rowspan="3"><a href="muasanpham.jsp?masanpham=<%=sp.getMaSanPham() %>"><input type="button" name="btmua" id="btmua" value="Mua" /></a><br/>
         <a href ="giohang_controller?action=themvaogiohang&&masanpham=<%=sp.getMaSanPham()%>"> <input type="button" name="button" id="btthemvaogiohang" value="Thêm vào giỏ hàng" /></a><br/>
          <a href ="chitietsanpham.jsp?masanpham=<%=sp.getMaSanPham()%>&&maloaisanpham=<%=sp.getMaLoai() %>&&madanhmuc=<%=sp.getMaDanhMuc() %>">Xem chi tiết</a>
        </td>
      </tr>
      <tr>
        <td><img src="<%=sp.getImage() %>" width="100" height="86" /></td>
      </tr>
      <tr>
          <td>Giá bán:<font color="red"><strong><%=sp.getGia() %> K</strong></font></td>
      </tr>
    </table>
          
    </td>
  </tr>
  <%}%>
  <tr>
    <td>Trang 
        <%for(int i = 1;i<=sotrang;i++){ %> 
        <a href="sanpham_controller?action=timkiemsanpham&&txtkey=<%=keyword%>&&cbloaisanpham=<%=loai%>&&trang=<%=i %>">
        <%=i %>
        </a>
        
        <%}%>
    </td>
  </tr>
</table>
</form>
